package com.lemobar.pay.model.alipay;


import com.lemobar.pay.model.alipay.response.*;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.*;

import java.util.Map;

public interface AliPayApi {


    /**
     * 统一下单
     */
    @FormUrlEncoded
    @Headers("Content-Type:application/x-www-form-urlencoded; charset=utf-8")
    @POST("gateway.do?charset=utf-8")
    Call<AliPayTradeCreateResponse> tradeCreate(@FieldMap Map<String, String> map);

    /**
     * wap下单
     * alipay.trade.wap.pay
     */
    @FormUrlEncoded
    @Headers("Content-Type:application/x-www-form-urlencoded; charset=utf-8")
    @POST("gateway.do?charset=utf-8")
    Call<ResponseBody> tradeWapPay(@FieldMap Map<String, String> map);

    /**
     * 付款码下单 alipay.trade.pay(统一收单交易支付接口)
     * alipay.trade.pay
     */
    @FormUrlEncoded
    @Headers("Content-Type:application/x-www-form-urlencoded; charset=utf-8")
    @POST("gateway.do?charset=utf-8")
    Call<AliPayTradePayResponse> tradePay(@FieldMap Map<String, String> map);


    /**
     * 查询订单
     * alipay.trade.query
     */
    @FormUrlEncoded
    @POST("gateway.do?charset=utf-8")
    Call<AliPayTradeQueryResponse> tradeQuery(@FieldMap Map<String, String> map);


    @FormUrlEncoded
    @POST("gateway.do?charset=utf-8")
    Call<AlipayTradeCloseResponse> close(@FieldMap Map<String, String> map);

    @Headers("Cache-Control: max-age=640000")
    @FormUrlEncoded
    @POST("gateway.do?charset=utf-8")
    Call<AliPayTradeRefundResponse> refund(@FieldMap Map<String, String> map);

    @FormUrlEncoded
    @POST("gateway.do?charset=utf-8")
    Call<AlipayTradeFastpayRefundQueryResponse> refundQuery(@FieldMap Map<String, String> map);

    @FormUrlEncoded
    @POST("gateway.do?charset=utf-8")
    Call<AliPayTradeCancelResponse> reverse(@FieldMap Map<String, String> map);





    @FormUrlEncoded
    @POST("gateway.do?charset=utf-8")
    Call<AliPayBankResponse> payBank(@FieldMap Map<String, String> map);



    // *******************************【备份】***********************************************************

    /**
     * 统一下单
     */
    @FormUrlEncoded
    @Headers("Content-Type:application/x-www-form-urlencoded; charset=utf-8")
    @POST("gateway.do?charset=utf-8")
    Call<AliPayOrderCreateResponse> tradeCreate2(@FieldMap Map<String, String> map);

}
